home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / performPolyRotateUVs.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.6 KB  |  137 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  2 June 1999
  22. //
  23. //  Procedure Name:
  24. //      performPolyRotateUVs
  25. //
  26. //  Description:
  27. //        Rotates UVs
  28. //         
  29. //  Input Arguments:
  30. //        $option : Whether to set the options to default values.
  31. //  Return Value:
  32. //        command string iff $option==2
  33. //
  34.  
  35. proc setOptionVars (int $forceFactorySettings)
  36. {
  37.     if ($forceFactorySettings || !`optionVar -exists polyRotateUVAngle`) {
  38.         optionVar -floatValue polyRotateUVAngle 90;
  39.     }
  40. }
  41.  
  42. global proc performPolyRotateUVsSetup (string $parent, int $forceFactorySettings)
  43. {
  44.     setOptionVars($forceFactorySettings);
  45.     setParent $parent;
  46.  
  47.     float $ang = `optionVar -q polyRotateUVAngle`;
  48.     floatSliderGrp -edit -value $ang polyRotateUVAngle;
  49. }
  50.  
  51. global proc performPolyRotateUVsCallback (string $parent, int $doIt)
  52. {
  53.     setParent $parent;
  54.     
  55.     float $ang = `floatSliderGrp -query -value polyRotateUVAngle`;
  56.     optionVar -floatValue polyRotateUVAngle $ang;
  57.  
  58.     if ($doIt) {
  59.         performPolyRotateUVs 0;
  60.         addToRecentCommandQueue "performPolyRotateUVs 0" "PolyRotateUVs";
  61.     }
  62. }
  63.  
  64. proc polyRotateUVsOptions ()
  65. {
  66.     string $layout = getOptionBox();
  67.     setParent $layout;
  68.  
  69.     setUITemplate -pushTemplate DefaultTemplate;
  70.     waitCursor -state 1;
  71.     tabLayout -scr true -tv false;
  72.     
  73.     string $parent = `columnLayout -adjustableColumn 1`;
  74.     
  75.     string $commandName = "performPolyRotateUVs";
  76.     string $callback = ($commandName + "Callback " + $parent + " ");
  77.     string $setup = ($commandName + "Setup "  + $parent + " ");
  78.  
  79.     setOptionBoxCommandName($commandName);
  80.  
  81.     floatSliderGrp -label "Rotation Angle" -min -360.0 -max 360.0 -v 90.0 polyRotateUVAngle;
  82.  
  83.     waitCursor -state 0;
  84.     setUITemplate -popTemplate;
  85.        
  86.     string $applyBtn = getOptionBoxApplyBtn();
  87.     button -edit -label "Rotate"
  88.            -command ($callback + 1)
  89.         $applyBtn;
  90.     string $saveBtn = getOptionBoxSaveBtn();
  91.     button -edit 
  92.         -command ($callback + 0 + "; hideOptionBox")
  93.         $saveBtn;
  94.     string $resetBtn = getOptionBoxResetBtn();
  95.     button -edit 
  96.         -command ($setup + 1)
  97.         $resetBtn;
  98.              
  99.     setOptionBoxTitle("Rotate UVs Options");
  100.  
  101.     setOptionBoxHelpTag( "RotateUVs" );
  102.  
  103.     eval (($setup + 0));
  104.     showOptionBox();
  105. }
  106.  
  107. proc string assembleCmd()
  108. {
  109.     int $doHistory = `constructionHistory -q -toggle`;
  110.  
  111.     string $cmd=("polyRotateUVs ");
  112.  
  113.     float $ang = `optionVar -q polyRotateUVAngle`;
  114.     $cmd += $ang;
  115.  
  116.     return $cmd;    
  117. }
  118.  
  119. global proc string performPolyRotateUVs(int $option)
  120. {
  121.     string $cmd="";
  122.  
  123.     switch ($option) {
  124.     case 0:
  125.             string $cmd=`assembleCmd `;
  126.             string $res=`evalEcho $cmd`;
  127.             break;
  128.  
  129.     case 1: polyRotateUVsOptions; break;
  130.     case 2: $cmd=`assembleCmd`;    break;
  131.     default:
  132.         $cmd = ("performPolyRotateUVs 0");
  133.     }
  134.     return $cmd;
  135. }
  136.  
  137.